import { InputNumber } from 'antd';
import styles from './ddd.module.less';

type DDDProps = {
  className?: string;
  maximum: number;
  minimum: number;
  value: number | null;
  onChange: (val: number | null) => void;
};

const DDD = (props: DDDProps) => {
  const { className, maximum, minimum, value, onChange } = props;

  return (
    <div className={`${styles.root} ${className}`}>
      <InputNumber
        value={value || null}
        style={{ width: 264, marginRight: 5 }}
        precision={6}
        max={maximum}
        min={minimum}
        suffix="°"
        placeholder="+ DD.DDDDDD"
        onChange={onChange}
      />
    </div>
  );
};

export default DDD;
